<template>
  <div class="model-table">
    <div class="model-table-row model-table-row-header">
      <div class="model-table-row-cell">
        参数名
      </div>
      <div class="model-table-row-cell">
         参数值
      </div>
      <div class="model-table-row-cell">
        是否上传标识解析
      </div>
    </div>
    <div
      v-for="(item, index) in value4"
      class="model-table-row model-table-row-body"
    >
      <div class="model-table-row-cell">
        <el-input
          v-model="item.name"
          class="model-table-row-cell-input"
          placeholder="请输入参数名"
          clearable
          size="small"
        />
      </div>
      <div class="model-table-row-cell">
        <el-input
          v-model="item.value"
          class="model-table-row-cell-input"
          placeholder="请输入参数值"
          clearable
          size="small"
        />
      </div>
      <div class="model-table-row-cell">
        <el-switch v-model="item.isUpload" />
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref } from "vue";
import "@/utils/style/modelStyle.scss";
const value4 = defineModel("value4");
const addItem = (index) => {
  value4.value.splice(index + 1, 0, {
    name: "",
    value: "",
    isUpload: false,
  });
};
const deleteItem = (index) => {
  value4.value.splice(index, 1);
};
const upItem = (index) => {
  const temp = value4.value[index];
  value4.value[index] = value4.value[index - 1];
  value4.value[index - 1] = temp;
};
const downItem = (index) => {
  const temp = value4.value[index];
  value4.value[index] = value4.value[index + 1];
  value4.value[index + 1] = temp;
};
</script>
<style lang="scss"></style>
